// Copyright 2007 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package lichen.internal.hibernate;

import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import lichen.hibernate.EntityService;

import org.hibernate.Filter;
import org.hibernate.HibernateException;
import org.hibernate.Interceptor;
import org.hibernate.LockMode;
import org.hibernate.ReplicationMode;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.support.SQLExceptionTranslator;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 实体服务类的实现.
 * <p>
 * 实际上{@link HibernateTemplate}的代理类.
 * 
 * @author jcai
 * @version $Revision: 170 $
 * @since 0.0.3
 * @see HibernateTemplate
 */
public class EntityServiceImpl implements EntityService {
	/** hibernate 模板类 * */
	public HibernateTemplate _template;

	public EntityServiceImpl(HibernateTemplate template) {
		_template = template;
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#bulkUpdate(java.lang.String,
	 *      java.lang.Object)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public int bulkUpdate(String queryString, Object value)
			throws DataAccessException {
		return _template.bulkUpdate(queryString, value);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#bulkUpdate(java.lang.String,
	 *      java.lang.Object[])
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public int bulkUpdate(String queryString, Object[] values)
			throws DataAccessException {
		return _template.bulkUpdate(queryString, values);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#bulkUpdate(java.lang.String)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public int bulkUpdate(String queryString) throws DataAccessException {
		return _template.bulkUpdate(queryString);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#clear()
	 */
	public void clear() throws DataAccessException {
		_template.clear();
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#closeIterator(java.util.Iterator)
	 */
	public void closeIterator(Iterator it) throws DataAccessException {
		_template.closeIterator(it);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#contains(java.lang.Object)
	 */
	public boolean contains(Object entity) throws DataAccessException {
		return _template.contains(entity);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateAccessor#convertHibernateAccessException(org.hibernate.HibernateException)
	 */
	public DataAccessException convertHibernateAccessException(
			HibernateException ex) {
		return _template.convertHibernateAccessException(ex);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#delete(java.lang.Object,
	 *      org.hibernate.LockMode)
	 */
	public void delete(Object entity, LockMode lockMode)
			throws DataAccessException {
		_template.delete(entity, lockMode);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#delete(java.lang.Object)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void delete(Object entity) throws DataAccessException {
		_template.delete(entity);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#deleteAll(java.util.Collection)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void deleteAll(Collection entities) throws DataAccessException {
		_template.deleteAll(entities);
	}

	/**
	 * 
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#enableFilter(java.lang.String)
	 */
	public Filter enableFilter(String filterName) throws IllegalStateException {
		return _template.enableFilter(filterName);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#evict(java.lang.Object)
	 */
	public void evict(Object entity) throws DataAccessException {
		_template.evict(entity);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#execute(org.springframework.orm.hibernate3.HibernateCallback,
	 *      boolean)
	 */
	public Object execute(HibernateCallback action, boolean exposeNativeSession)
			throws DataAccessException {
		return _template.execute(action, exposeNativeSession);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#execute(org.springframework.orm.hibernate3.HibernateCallback)
	 */
	public Object execute(HibernateCallback action) throws DataAccessException {
		return _template.execute(action);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#executeFind(org.springframework.orm.hibernate3.HibernateCallback)
	 */
	public List executeFind(HibernateCallback action)
			throws DataAccessException {
		return _template.executeFind(action);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#find(java.lang.String,
	 *      java.lang.Object)
	 */
	public List find(String queryString, Object value)
			throws DataAccessException {
		return _template.find(queryString, value);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#find(java.lang.String,
	 *      java.lang.Object[])
	 */
	public List find(String queryString, Object[] values)
			throws DataAccessException {
		return _template.find(queryString, values);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#find(java.lang.String)
	 */
	public List find(String queryString) throws DataAccessException {
		return _template.find(queryString);
	}

	/**





	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByCriteria(org.hibernate.criterion.DetachedCriteria,
	 *      int, int)
	 */
	public List findByCriteria(DetachedCriteria criteria, int firstResult,
			int maxResults) throws DataAccessException {
		return _template.findByCriteria(criteria, firstResult, maxResults);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByCriteria(org.hibernate.criterion.DetachedCriteria)
	 */
	public List findByCriteria(DetachedCriteria criteria)
			throws DataAccessException {
		return _template.findByCriteria(criteria);
	}

	/**





	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByExample(java.lang.Object,
	 *      int, int)
	 */
	public List findByExample(Object exampleEntity, int firstResult,
			int maxResults) throws DataAccessException {
		return _template.findByExample(exampleEntity, firstResult, maxResults);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByExample(java.lang.Object)
	 */
	public List findByExample(Object exampleEntity) throws DataAccessException {
		return _template.findByExample(exampleEntity);
	}

	/**





	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByNamedParam(java.lang.String,
	 *      java.lang.String, java.lang.Object)
	 */
	public List findByNamedParam(String queryString, String paramName,
			Object value) throws DataAccessException {
		return _template.findByNamedParam(queryString, paramName, value);
	}

	/**





	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByNamedParam(java.lang.String,
	 *      java.lang.String[], java.lang.Object[])
	 */
	public List findByNamedParam(String queryString, String[] paramNames,
			Object[] values) throws DataAccessException {
		return _template.findByNamedParam(queryString, paramNames, values);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByNamedQuery(java.lang.String,
	 *      java.lang.Object)
	 */
	public List findByNamedQuery(String queryName, Object value)
			throws DataAccessException {
		return _template.findByNamedQuery(queryName, value);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByNamedQuery(java.lang.String,
	 *      java.lang.Object[])
	 */
	public List findByNamedQuery(String queryName, Object[] values)
			throws DataAccessException {
		return _template.findByNamedQuery(queryName, values);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByNamedQuery(java.lang.String)
	 */
	public List findByNamedQuery(String queryName) throws DataAccessException {
		return _template.findByNamedQuery(queryName);
	}

	/**





	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByNamedQueryAndNamedParam(java.lang.String,
	 *      java.lang.String, java.lang.Object)
	 */
	public List findByNamedQueryAndNamedParam(String queryName,
			String paramName, Object value) throws DataAccessException {
		return _template.findByNamedQueryAndNamedParam(queryName, paramName,
				value);
	}

	/**





	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByNamedQueryAndNamedParam(java.lang.String,
	 *      java.lang.String[], java.lang.Object[])
	 */
	public List findByNamedQueryAndNamedParam(String queryName,
			String[] paramNames, Object[] values) throws DataAccessException {
		return _template.findByNamedQueryAndNamedParam(queryName, paramNames,
				values);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByNamedQueryAndValueBean(java.lang.String,
	 *      java.lang.Object)
	 */
	public List findByNamedQueryAndValueBean(String queryName, Object valueBean)
			throws DataAccessException {
		return _template.findByNamedQueryAndValueBean(queryName, valueBean);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#findByValueBean(java.lang.String,
	 *      java.lang.Object)
	 */
	public List findByValueBean(String queryString, Object valueBean)
			throws DataAccessException {
		return _template.findByValueBean(queryString, valueBean);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#flush()
	 */
	public void flush() throws DataAccessException {
		_template.flush();
	}

	/**





	 * @see org.springframework.orm.hibernate3.HibernateTemplate#get(java.lang.Class,
	 *      java.io.Serializable, org.hibernate.LockMode)
	 */
	public Object get(Class entityClass, Serializable id, LockMode lockMode)
			throws DataAccessException {
		return _template.get(entityClass, id, lockMode);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#get(java.lang.Class,
	 *      java.io.Serializable)
	 */
	public Object get(Class entityClass, Serializable id)
			throws DataAccessException {
		return _template.get(entityClass, id);
	}

	/**





	 * @see org.springframework.orm.hibernate3.HibernateTemplate#get(java.lang.String,
	 *      java.io.Serializable, org.hibernate.LockMode)
	 */
	public Object get(String entityName, Serializable id, LockMode lockMode)
			throws DataAccessException {
		return _template.get(entityName, id, lockMode);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#get(java.lang.String,
	 *      java.io.Serializable)
	 */
	public Object get(String entityName, Serializable id)
			throws DataAccessException {
		return _template.get(entityName, id);
	}

	/**
	 * 
	 * 
	 * @see org.springframework.orm.hibernate3.HibernateAccessor#getEntityInterceptor()
	 */
	public Interceptor getEntityInterceptor() throws IllegalStateException,
			BeansException {
		return _template.getEntityInterceptor();
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#getFetchSize()
	 */
	public int getFetchSize() {
		return _template.getFetchSize();
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#getFilterNames()
	 */
	public String[] getFilterNames() {
		return _template.getFilterNames();
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#getFlushMode()
	 */
	public int getFlushMode() {
		return _template.getFlushMode();
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#getJdbcExceptionTranslator()
	 */
	public SQLExceptionTranslator getJdbcExceptionTranslator() {
		return _template.getJdbcExceptionTranslator();
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#getMaxResults()
	 */
	public int getMaxResults() {
		return _template.getMaxResults();
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#getQueryCacheRegion()
	 */
	public String getQueryCacheRegion() {
		return _template.getQueryCacheRegion();
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#getSessionFactory()
	 */
	public SessionFactory getSessionFactory() {
		return _template.getSessionFactory();
	}

	/**


	 * @see org.springframework.orm.hibernate3.HibernateTemplate#initialize(java.lang.Object)
	 */
	public void initialize(Object proxy) throws DataAccessException {
		_template.initialize(proxy);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#isAllowCreate()
	 */
	public boolean isAllowCreate() {
		return _template.isAllowCreate();
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#isAlwaysUseNewSession()
	 */
	public boolean isAlwaysUseNewSession() {
		return _template.isAlwaysUseNewSession();
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#isCacheQueries()
	 */
	public boolean isCacheQueries() {
		return _template.isCacheQueries();
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#isCheckWriteOperations()
	 */
	public boolean isCheckWriteOperations() {
		return _template.isCheckWriteOperations();
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#isExposeNativeSession()
	 */
	public boolean isExposeNativeSession() {
		return _template.isExposeNativeSession();
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#iterate(java.lang.String,
	 *      java.lang.Object)
	 */
	public Iterator iterate(String queryString, Object value)
			throws DataAccessException {
		return _template.iterate(queryString, value);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#iterate(java.lang.String,
	 *      java.lang.Object[])
	 */
	public Iterator iterate(String queryString, Object[] values)
			throws DataAccessException {
		return _template.iterate(queryString, values);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#iterate(java.lang.String)
	 */
	public Iterator iterate(String queryString) throws DataAccessException {
		return _template.iterate(queryString);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#load(java.lang.Class,
	 *      java.io.Serializable, org.hibernate.LockMode)
	 */
	public Object load(Class entityClass, Serializable id, LockMode lockMode)
			throws DataAccessException {
		return _template.load(entityClass, id, lockMode);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#load(java.lang.Class,
	 *      java.io.Serializable)
	 */
	public Object load(Class entityClass, Serializable id)
			throws DataAccessException {
		return _template.load(entityClass, id);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#load(java.lang.Object,
	 *      java.io.Serializable)
	 */
	public void load(Object entity, Serializable id) throws DataAccessException {
		_template.load(entity, id);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#load(java.lang.String,
	 *      java.io.Serializable, org.hibernate.LockMode)
	 */
	public Object load(String entityName, Serializable id, LockMode lockMode)
			throws DataAccessException {
		return _template.load(entityName, id, lockMode);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#load(java.lang.String,
	 *      java.io.Serializable)
	 */
	public Object load(String entityName, Serializable id)
			throws DataAccessException {
		return _template.load(entityName, id);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#loadAll(java.lang.Class)
	 */
	public List loadAll(Class entityClass) throws DataAccessException {
		return _template.loadAll(entityClass);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#lock(java.lang.Object,
	 *      org.hibernate.LockMode)
	 */
	public void lock(Object entity, LockMode lockMode)
			throws DataAccessException {
		_template.lock(entity, lockMode);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#lock(java.lang.String,
	 *      java.lang.Object, org.hibernate.LockMode)
	 */
	public void lock(String entityName, Object entity, LockMode lockMode)
			throws DataAccessException {
		_template.lock(entityName, entity, lockMode);
	}

	/**
	 * @see org.springframework.orm.hibernate3.HibernateTemplate#merge(java.lang.Object)
	 */
	public Object merge(Object entity) throws DataAccessException {
		return _template.merge(entity);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#merge(java.lang.String,
	 *      java.lang.Object)
	 */
	public Object merge(String entityName, Object entity)
			throws DataAccessException {
		return _template.merge(entityName, entity);
	}

	/**


	 * @see org.springframework.orm.hibernate3.HibernateTemplate#persist(java.lang.Object)
	 */
	public void persist(Object entity) throws DataAccessException {
		_template.persist(entity);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#persist(java.lang.String,
	 *      java.lang.Object)
	 */
	public void persist(String entityName, Object entity)
			throws DataAccessException {
		_template.persist(entityName, entity);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#refresh(java.lang.Object,
	 *      org.hibernate.LockMode)
	 */
	public void refresh(Object entity, LockMode lockMode)
			throws DataAccessException {
		_template.refresh(entity, lockMode);
	}

	/**


	 * @see org.springframework.orm.hibernate3.HibernateTemplate#refresh(java.lang.Object)
	 */
	public void refresh(Object entity) throws DataAccessException {
		_template.refresh(entity);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#replicate(java.lang.Object,
	 *      org.hibernate.ReplicationMode)
	 */
	public void replicate(Object entity, ReplicationMode replicationMode)
			throws DataAccessException {
		_template.replicate(entity, replicationMode);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#replicate(java.lang.String,
	 *      java.lang.Object, org.hibernate.ReplicationMode)
	 */
	public void replicate(String entityName, Object entity,
			ReplicationMode replicationMode) throws DataAccessException {
		_template.replicate(entityName, entity, replicationMode);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#save(java.lang.Object)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public Serializable save(Object entity) throws DataAccessException {
		return _template.save(entity);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#save(java.lang.String,
	 *      java.lang.Object)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public Serializable save(String entityName, Object entity)
			throws DataAccessException {
		return _template.save(entityName, entity);
	}

	/**


	 * @see org.springframework.orm.hibernate3.HibernateTemplate#saveOrUpdate(java.lang.Object)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void saveOrUpdate(Object entity) throws DataAccessException {
		_template.saveOrUpdate(entity);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#saveOrUpdate(java.lang.String,
	 *      java.lang.Object)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void saveOrUpdate(String entityName, Object entity)
			throws DataAccessException {
		_template.saveOrUpdate(entityName, entity);
	}

	/**


	 * @see org.springframework.orm.hibernate3.HibernateTemplate#saveOrUpdateAll(java.util.Collection)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void saveOrUpdateAll(Collection entities) throws DataAccessException {
		_template.saveOrUpdateAll(entities);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#setAllowCreate(boolean)
	 */
	public void setAllowCreate(boolean allowCreate) {
		_template.setAllowCreate(allowCreate);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#setAlwaysUseNewSession(boolean)
	 */
	public void setAlwaysUseNewSession(boolean alwaysUseNewSession) {
		_template.setAlwaysUseNewSession(alwaysUseNewSession);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setBeanFactory(org.springframework.beans.factory.BeanFactory)
	 */
	public void setBeanFactory(BeanFactory beanFactory) {
		_template.setBeanFactory(beanFactory);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#setCacheQueries(boolean)
	 */
	public void setCacheQueries(boolean cacheQueries) {
		_template.setCacheQueries(cacheQueries);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#setCheckWriteOperations(boolean)
	 */
	public void setCheckWriteOperations(boolean checkWriteOperations) {
		_template.setCheckWriteOperations(checkWriteOperations);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setEntityInterceptor(org.hibernate.Interceptor)
	 */
	public void setEntityInterceptor(Interceptor entityInterceptor) {
		_template.setEntityInterceptor(entityInterceptor);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setEntityInterceptorBeanName(java.lang.String)
	 */
	public void setEntityInterceptorBeanName(String entityInterceptorBeanName) {
		_template.setEntityInterceptorBeanName(entityInterceptorBeanName);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#setExposeNativeSession(boolean)
	 */
	public void setExposeNativeSession(boolean exposeNativeSession) {
		_template.setExposeNativeSession(exposeNativeSession);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#setFetchSize(int)
	 */
	public void setFetchSize(int fetchSize) {
		_template.setFetchSize(fetchSize);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setFilterName(java.lang.String)
	 */
	public void setFilterName(String filter) {
		_template.setFilterName(filter);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setFilterNames(java.lang.String[])
	 */
	public void setFilterNames(String[] filterNames) {
		_template.setFilterNames(filterNames);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setFlushMode(int)
	 */
	public void setFlushMode(int flushMode) {
		_template.setFlushMode(flushMode);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setFlushModeName(java.lang.String)
	 */
	public void setFlushModeName(String constantName) {
		_template.setFlushModeName(constantName);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setJdbcExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)
	 */
	public void setJdbcExceptionTranslator(
			SQLExceptionTranslator jdbcExceptionTranslator) {
		_template.setJdbcExceptionTranslator(jdbcExceptionTranslator);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#setMaxResults(int)
	 */
	public void setMaxResults(int maxResults) {
		_template.setMaxResults(maxResults);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateTemplate#setQueryCacheRegion(java.lang.String)
	 */
	public void setQueryCacheRegion(String queryCacheRegion) {
		_template.setQueryCacheRegion(queryCacheRegion);
	}

	/**

	 * @see org.springframework.orm.hibernate3.HibernateAccessor#setSessionFactory(org.hibernate.SessionFactory)
	 */
	public void setSessionFactory(SessionFactory sessionFactory) {
		_template.setSessionFactory(sessionFactory);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#update(java.lang.Object,
	 *      org.hibernate.LockMode)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void update(Object entity, LockMode lockMode)
			throws DataAccessException {
		_template.update(entity, lockMode);
	}

	/**


	 * @see org.springframework.orm.hibernate3.HibernateTemplate#update(java.lang.Object)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void update(Object entity) throws DataAccessException {
		_template.update(entity);
	}

	/**




	 * @see org.springframework.orm.hibernate3.HibernateTemplate#update(java.lang.String,
	 *      java.lang.Object, org.hibernate.LockMode)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void update(String entityName, Object entity, LockMode lockMode)
			throws DataAccessException {
		_template.update(entityName, entity, lockMode);
	}

	/**



	 * @see org.springframework.orm.hibernate3.HibernateTemplate#update(java.lang.String,
	 *      java.lang.Object)
	 */
	@Transactional(propagation=Propagation.REQUIRED)
	public void update(String entityName, Object entity)
			throws DataAccessException {
		_template.update(entityName, entity);
	}

}
